package cn.lls.service;

import cn.lls.entity.company.CompanyBaseEntity;
import cn.lls.req.company.AuditCompanyReq;
import cn.lls.req.company.CompanyReq;
import cn.lls.req.company.ConditionSearchCompanyReq;
import cn.lls.vo.company.CompanyAllInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

/**
 * @InterfaceName ICompanyAllInfoService
 * @Author 划水艺术家
 * @Date 2022/11/16 14:24
 * @Version 1.0
 **/
public interface ICompanyAllInfoService extends IService<CompanyReq> {

    /*
    公司信息注册，即将信息插入两个表
    */
    @Transactional
    void companyEnroll(CompanyReq companyReq);


    @Transactional
    void companyUpdate(CompanyReq companyReq);

    /*
    超级管理员分页条件查询公司
     */
    IPage<CompanyAllInfo> getCompanyInfoByPageAndCondition(ConditionSearchCompanyReq conditionSearchCompanyReq);

    /*
       根据超管行为，做出决策。包括生成账号、密码，发送邮箱
    */
    void executeByBehavior(AuditCompanyReq auditCompanyReq, CompanyBaseEntity companyBase);

    /*
        根据公司当前状态判断行为是否合理
     */
    Boolean verifyBehavior(Integer behavior, Integer companyStatus);


    CompanyAllInfo getCompanyById(Long companyId);
}
